<%-- 
    Document   : departemen_main
    Created on : Nov 20, 2008, 2:24:02 PM
    Author     : hp02
--%>

<%@page contentType="text/html" pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html" %>
<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
   "http://www.w3.org/TR/html4/loose.dtd">
<h3>Departments</h3>
<table>
    <tr>
        <td class="menucon">
            <html:link action="/dept_new.do">New Department</html:link>
        </td>
    </tr>
</table>
<html:messages id="messages" property="customMessage" message="true">
    <div><bean:write name="messages"/></div>
</html:messages>
<html:messages id="messages" property="message" message="true">
    <ul>
        <li><bean:write name="messages"/></li>
    </ul>
</html:messages>
<table>
    <tr class="table_header">
        <th>No.</th>
        <th>Code</th>
        <th>Department Name</th>
        <th>Action</th>
    </tr>
    <c:set var="x" value="0"/>
    <c:forEach items="${departemens}" var="departemen">
        <tr>
            <td>${x+1}.</td>
            <td><html:link action="/dept_getdept.do?id=${departemen.id}">${departemen.kode}</html:link></td>
            <td>${departemen.nama}</td>
            <td>
                <html:link action="/dept_delete.do?id=${departemen.id}">Delete</html:link> 
                <html:link action="/dept_preupdate.do?id=${departemen.id}">Edit</html:link>
            </td>            
        </tr>
        <c:set var="x" value="${x+1}"/>
    </c:forEach>
        <tr class="table_footer">
            <td colspan="10">PT. Dhemar Nusantara - PT. Rahmi Ida Nusantara</td>
        </tr>
</table>